home *** CD-ROM | disk | FTP | other *** search
/ The SelectWare System Volume 5 #4 / The SelectWare System Volume 5 #4.iso / com95003 / setup.inf < prev    next >
Text File  |  1992-11-04  |  48KB  |  1,232 lines

  1.  
  2.     ;;*************Begin Title Specific Section***************************
  3.  
  4.     ;;
  5.     ;; SetVariable (Variable, String)
  6.     ;; ------------------------------
  7.     ;; This command sets the variable named 'Variable' to the string
  8.     ;; 'String'.
  9.     ;;
  10.  
  11.     ;;     Change this variable to be the name of the title.
  12.     ;;
  13. SetVariable (TitleName, "Jazz: A Multimedia History")    ; Name of the title
  14.  
  15.     ;;    Change this variable to be the basename of the title's MVB
  16.     ;;    file (i.e. the name of the MVB file without the .MVB 
  17.     ;;    extension).
  18.     ;;
  19. SetVariable (TitleMVB, "JAZZ")        ; Basename of the MVB file
  20.  
  21.     ;;    Change this variable to be the subdirectory of the title
  22.     ;;    on the CD-ROM (i.e. where the MVB file is located).  This 
  23.     ;;    subdirectory will be in the Viewer directory on the CD-ROM,
  24.     ;;    where VIEWER.EXE and SETUP.EXE are located.  Do not specify
  25.     ;;    the complete path for this subdirectory.
  26.     ;;
  27. SetVariable (TitleSrcDir, "\JAZZ\")    ; Source subdirectory of the title
  28.  
  29.     ;;***************End Title Specific Section***************************
  30.  
  31.     ;;
  32.     ;; GetCurPath (Variable)
  33.     ;; ---------------------
  34.     ;; This command sets the variable 'Variable' to the current path.
  35.     ;; This is the full path of the directory in which SETUP.EXE was 
  36.     ;; started.  A directory name ends in a backslash.
  37.     ;;
  38.  
  39. GetCurPath (ViewerSrcDir)        ; Source directory of the Viewer
  40. SetVariable (ViewerSize, 1 000 000)    ; Size of the Viewer files that will
  41.                     ;  be copied over (measured in bytes)
  42. SetVariable (ViewerDestDir, "C:\VIEWER\")    ; Destination directory for 
  43.                         ;  the Viewer.  Set default
  44.                         ;  here.
  45.  
  46.     ;;
  47.     ;; WindowTitle (Title)
  48.     ;; -------------------
  49.     ;; This command sets the title bar of all subsequent dialog windows to
  50.     ;; the string 'Title'.  The title string must be limited to 127 
  51.     ;; characters.  The title bar can be changed before the first dialog
  52.     ;; window is shown or at any later time using this command.  By 
  53.     ;; default, the title for all dialog windows is "Setup".
  54.     ;;
  55.  
  56. ; Set the title of all dialog windows.
  57. ;
  58. WindowTitle (<TitleName> " Setup")
  59.  
  60.  
  61. ; Set the instruction text used in the initial instructions window.
  62. ; Add Help instructions if the file SETUP.HLP exists.
  63. ;
  64. SetVariable (InitialInstructions, 
  65.     "Click on {\b OK} or press {\b Enter} to continue.  "
  66.     "To abort the setup, click on the {\b Exit} button at the "
  67.     "bottom right corner of the screen, or press {\b F3}.  ")
  68.  
  69.     ;;
  70.     ;; IfFileExistsGoto (FileName, Label)
  71.     ;; ----------------------------------
  72.     ;; This command causes execution to jump to label 'Label' if the
  73.     ;; specified file exists.  This command can be used while the copy
  74.     ;; progress bar is up, but if you do so then you should not check if a
  75.     ;; file exists if that file has been created between the 
  76.     ;; 'OpenCopyProgress' and the 'IfFileExistsGoto'.  The reason for this
  77.     ;; is that 'OpenCopyProgress' will first step through all the copy and
  78.     ;; branching commands until the 'CloseCopyProgress' command without
  79.     ;; actually copying any files.  This is done in order to find the
  80.     ;; range for the copy progress bar.  The 'IfFileExistsGoto' command
  81.     ;; is typically used to see if you are reinstalling files.
  82.     ;;
  83.  
  84. IfFileExistsGoto ("SETUP.HLP", AddHelpInstructions)
  85.  
  86.     ;;
  87.     ;; Goto (Label)
  88.     ;; ------------
  89.     ;; This command will unconditionally cause execution to branch to the
  90.     ;; label 'Label'.
  91.     ;;
  92.  
  93.     Goto (DisplayInitialMessage)
  94. AddHelpInstructions:
  95.     SetVariable (InitialInstructions, 
  96.         <InitialInstructions> "You can always obtain help by "
  97.         "clicking on the {\b Help} button or pressing {\b F1}.  ")
  98.  
  99.     ;;
  100.     ;; DisplayMessage (Text, Instructions)
  101.     ;; -----------------------------------
  102.     ;; This command displays the message 'Text' in a dialog box and the
  103.     ;; instruction text 'Instructions' in the instructions window.  
  104.     ;; A single "OK" default push button at the bottom center of the 
  105.     ;; dialog is used to resume.
  106.     ;;
  107.  
  108. ; Display the initial message.
  109. ;
  110. DisplayInitialMessage:
  111. DisplayMessage (
  112.     "
  113.         
  114.     This Setup program will install:
  115.     
  116.         " <TitleName> "
  117.     
  118.         and the Multimedia Viewer.
  119.         
  120.     
  121.     You will be prompted for the location for the
  122.     Multimedia Viewer. This will require about 1
  123.     Megabyte of disk space.",
  124.     <InitialInstructions>)
  125.  
  126.     ;;
  127.     ;; GetFromWinIni (Variable, Section, Name, Default)
  128.     ;; ------------------------------------------------
  129.     ;; This command reads the WIN.INI file entry 'Name' under the section
  130.     ;; 'Section' and sets the variable 'Variable' to the result.  If the
  131.     ;; specified section or entry were not found, then the specified 
  132.     ;; variable is set to the string 'Default'.
  133.     ;;
  134.  
  135. ; Determine if the Viewer has been installed before.
  136. ; If the WIN.INI file contains information on where the Viewer directory
  137. ; is located, then make that the default path to install the Viewer.
  138. ;
  139. GetFromWinIni (ViewerDestDirTemp, 
  140.     "Multimedia Viewer", "ViewerPath", "Undefined")
  141.  
  142.     ;;
  143.     ;; IfEqualGoto (String1, String2, Label)
  144.     ;; -------------------------------------
  145.     ;; This command will do a case insensitive compare on the strings
  146.     ;; 'String1' and 'String2' and branch to label 'Label' if they match.
  147.     ;;
  148.  
  149. IfEqualGoto (<ViewerDestDirTemp>, "Undefined", PromptViewerDestDir)
  150. SetVariable (ViewerDestDir, <ViewerDestDirTemp>)
  151.  
  152.  
  153. AskAgain:
  154.  
  155.     ;;
  156.     ;; PromptPath (Variable, Default, Message, ValidInstructions,
  157.     ;;        InvalidInstructions)
  158.     ;; ----------------------------------------------------------
  159.     ;; This command causes a dialog box to appear that prompts the user 
  160.     ;; for a path.  The path is a directory that the setup script can use
  161.     ;; to copy into, make, etc.  The message 'Message' is shown at the top
  162.     ;; of the dialog, and the default path is 'Default'.   When PromptPath
  163.     ;; is invoked, Setup checks that the default specified in the INF file
  164.     ;; is a valid path on the user's machine. 
  165.     ;;
  166.     ;; The PromptPath dialog can be in two states.  Whenever the edit box
  167.     ;; contains a valid path, the OK button is available and the 
  168.     ;; 'ValidInstructions' text is displayed in the instruction window.
  169.     ;; Whenever the edit box contains an invalid path, the OK button is
  170.     ;; grayed out and the 'InvalidInstructions' text is displayed in the
  171.     ;; instruction window.
  172.     ;;
  173.     ;; All characters typed in the path edit box appear as upper case no
  174.     ;; matter what the keyboard shift state is in.  When the OK button is
  175.     ;; enabled, the user can click on the OK button or press Enter, upon
  176.     ;; which the path is placed in the variable 'Variable'.  Before
  177.     ;; returning the path however, PromptPath will translate all forward
  178.     ;; slashes to back slashes and ensure that the path ends in a
  179.     ;; back slash.
  180.     ;;
  181.  
  182. ; Ask for where the Multimedia Viewer should be installed.
  183. ;
  184. PromptViewerDestDir:
  185. PromptPath (ViewerDestDir, <ViewerDestDir>,
  186.     "Where should Setup install the Multimedia Viewer?",
  187.     "Modify the default path if necessary, and then click on {\b OK} or "
  188.     "press {\b Enter} to continue.  ",
  189.     "The path is currently not valid.  You must specify a drive "
  190.     "letter, a colon, and a directory from the root of the drive.  ")
  191.  
  192.     ;;
  193.     ;; GetWinPath (Variable)
  194.     ;; ---------------------
  195.     ;; This command sets the variable 'Variable' to the path of the
  196.     ;; Windows directory.  The directory name ends in a backslash.
  197.     ;;
  198.     ;;
  199.  
  200. ; Don't allow Viewer to be installed in the Windows directory
  201. ;
  202. GetWinSystemPath (SystemPath)
  203. GetWinPath (WinPath)
  204. IfNotEqualGoto (<ViewerDestDir>, <WinPath>, CheckSpace)
  205. DisplayMessage (
  206.     "You cannot install the Viewer into the Windows directory.  "
  207.     "Please enter another directory.",
  208.     "Click on {\b OK} or press {\b Enter} to enter another directory "
  209.     "for Viewer.")
  210. Goto (PromptViewerDestDir)
  211.  
  212.     ;;
  213.     ;; GetSpaceAvailable (Variable, Path)
  214.     ;; ----------------------------------
  215.     ;; This command finds the number of bytes available on the disk of 
  216.     ;; the full path 'Path', and sets the variable 'Variable' to the 
  217.     ;; string representation of this value.  The value 0 is returned if
  218.     ;; the specified volume does not exist or cannot be read.
  219.     ;;
  220.  
  221. ; Check if there is enough space to install the Viewer.
  222. ;
  223. CheckSpace:
  224. GetSpaceAvailable (SpaceAvailable, <ViewerDestDir>)
  225.  
  226.     ;;
  227.     ;; IfLowerGoto (Number1, Number2, Label)
  228.     ;; -------------------------------------
  229.     ;; This command will compare 'Number1' and 'Number2', which are 
  230.     ;; strings interpreted as integers.  If 'Number1' is lower than 
  231.     ;; 'Number2' then execution branches to 'Label'.
  232.     ;;
  233.  
  234. IfLowerGoto (<ViewerSize>, <SpaceAvailable>, ViewerDestDirOK)
  235.  
  236.     ;;
  237.     ;; AskYesNo (Variable, Default, Question, Instructions)
  238.     ;; ----------------------------------------------------
  239.     ;; This command displays the string 'Question' in a dialog box and the
  240.     ;; instruction text 'Instructions' in the instruction window.  The
  241.     ;; dialog box has two buttons, labeled "Yes" and "No".  The string
  242.     ;; 'Default' should be either "Yes" or "No" to specify which button is
  243.     ;; the default button.  After a button is pushed, the variable
  244.     ;; 'Variable' is set to the string "Yes" or the string "No" as
  245.     ;; appropriate.
  246.     ;;
  247.  
  248. AskYesNo (Prompt, "Yes",
  249.     "There may not be enough space to install the Multimedia Viewer.  "
  250.     "Would you like to enter a new path for the files?  ",
  251.     "Click on {\b Yes} or press {\b 'Y'} to enter a new path for the "
  252.     "Multimedia Viewer files.\par "
  253.     "Click on {\b No} or press {\b 'N'} to continue anyway.\par "
  254.     "Click on the {\b Exit} button or press {\b F3} to exit Setup.  "
  255.     "You may wish to exit Setup and make some more space on your hard "
  256.     "disk.  Run Setup again when there is enough space on your hard "
  257.     "disk.  ")
  258. IfEqualGoto (<Prompt>, "Yes", PromptViewerDestDir)
  259.  
  260.  
  261. ViewerDestDirOK:
  262. AskYesNo (AskAgain, "No", 
  263.     "Would you like to change anything before proceeding with "
  264.     "the installation?",
  265.     "Click on {\b Yes} or press {\b 'Y'} to reenter options.\par "
  266.     "Click on {\b No} or press {\b 'N'} to proceed with installation.  ")
  267. IfEqualGoto (<AskAgain>, "Yes", AskAgain)
  268.  
  269.     ;;
  270.     ;; MakePath (Path)
  271.     ;; ---------------
  272.     ;; This command causes the path 'Path' to be created if it does not
  273.     ;; already exist.  To make the path, MakePath creates any
  274.     ;; subdirectories that do not already exist.  If the path cannot be
  275.     ;; created, then no error will be reported, as the problem will
  276.     ;; normally be detected when Setup attempts to copy files to this
  277.     ;; path.
  278.     ;;
  279.  
  280. ; Create the tree structure.
  281. ;
  282. MakePath (<ViewerDestDir>)
  283.  
  284.     ;;
  285.     ;; OpenCopyProgress (Message, Instructions)
  286.     ;; ----------------------------------------
  287.     ;; This command begins a file manipulation section.  The command will
  288.     ;; open a progress bar dialog with the message 'Message' and the
  289.     ;; instruction text 'Instructions'.  Following this command, only the
  290.     ;; commands 'SetProgressBarMsg', 'PromptChangeDisk', 'CopyFile',
  291.     ;; 'AppendFile', 'UpdateFile', 'TranslateFile', 'DeleteFile', 
  292.     ;; 'RenameFile', 'Goto', 'IfEqualGoto', 'IfNotEqualGoto', 'ErrorExit',
  293.     ;; 'IfLowerGoto', 'IfHigherGoto', 'IfFileExistsGoto', 'Pause', and
  294.     ;; 'MakePath' are allowed until the 'CloseCopyProgress' command is
  295.     ;; reached.  An error is reported and Setup is aborted if any other
  296.     ;; commands are encountered while the progress bar is displayed.
  297.     ;;
  298.  
  299. ; Copy the files
  300. ;
  301. OpenCopyProgress (
  302.     "Setup is copying the Multimedia Viewer runtime files.",
  303.     "Please wait while Setup is copying files.")
  304.  
  305.     ;;
  306.     ;; CopyFile (Source, Destination, Size)
  307.     ;; ------------------------------------
  308.     ;; This command copies the file 'Source' to the file 'Destination'.
  309.     ;; The current disk and directory will be that of the Setup 
  310.     ;; executable.  Normally the files to copy will be in the same place
  311.     ;; (although a volume change may be required---see PromptChangeDisk)
  312.     ;; so a relative path is normally used for the source file name.
  313.     ;; Normally variables are used to specify a complete destination file
  314.     ;; name that depends on the user's path selection.  Any directories 
  315.     ;; specified in the destination path must already exist---they are
  316.     ;; normally created using the MakePath commands. 
  317.     ;;
  318.     ;; The 'Size' field specifies the size of the source file.  In order
  319.     ;; to initialize the progress bar it is necessary to find the total
  320.     ;; number of bytes to copy between the OpenCopyProgress command and
  321.     ;; the CloseCopyProgress command.  Since files may span several disks,
  322.     ;; it would be impractical to obtain this size directly from the 
  323.     ;; source file.  The size field is only required to maintain the
  324.     ;; progress bar, and, although it need not be exact, it should be
  325.     ;; close to reality to maintain the accuracy of the progress bar.
  326.     ;;
  327.     ;; If an error occurs (such as File Not Found, Read Error, Write 
  328.     ;; Error) then an error dialog is shown, at which point the user has
  329.     ;; the option to Abort Setup, Retry the copy operation, or Ignore the
  330.     ;; copy error.  Selecting Abort has the same effect as pressing <F3>. 
  331.     ;; Selecting Retry causes the operation to be retried.  Finally,
  332.     ;; selecting Ignore causes copying to continue despite the error.  The
  333.     ;; latter option will likely result in an incomplete Setup.  The
  334.     ;; command 'IfIncompleteGoto' can be used subsequently to give the 
  335.     ;; user an appropriate message.
  336.     ;;
  337.     ;; Files compressed using the Windows SDK COMPRESS utility will 
  338.     ;; automatically be decompressed as they are being copied to the hard
  339.     ;; disk. 
  340.     ;;
  341.  
  342. CopyFile ("FTENGINE.DLL", <ViewerDestDir> "FTENGINE.DLL",  50000)
  343. CopyFile ("FTUI.DLL",     <ViewerDestDir> "FTUI.DLL",      75000)
  344. CopyFile ("MMP.DLL",      <ViewerDestDir> "MMP.DLL",      200000)
  345. CopyFile ("MVAFF.DLL",    <ViewerDestDir> "MVAFF.DLL",     50000)
  346. CopyFile ("MVAPI.DLL",    <ViewerDestDir> "MVAPI.DLL",     10000)
  347. CopyFile ("MVAUDDLG.DLL", <ViewerDestDir> "MVAUDDLG.DLL",  50000)
  348. CopyFile ("MVAUDIO.DLL",  <ViewerDestDir> "MVAUDIO.DLL",   10000)
  349. CopyFile ("MVBMP.DLL",    <ViewerDestDir> "MVBMP.DLL",     50000)
  350. CopyFile ("QKHOOK.DLL",   <ViewerDestDir> "QKHOOK.DLL",    10000)
  351. CopyFile ("QUICKEYS.EXE", <ViewerDestDir> "QUICKEYS.EXE",  25000)
  352. CopyFile ("QUICKEYS.HLP", <ViewerDestDir> "QUICKEYS.HLP",  25000)
  353. CopyFile ("VIEWER.EXE",   <ViewerDestDir> "VIEWER.EXE",   250000)
  354.  
  355. CopyFile ("AVI.EXE",      <ViewerDestDir> "AVI.EXE",       20000)
  356. CopyFile ("DISPDIB.DLL",  <SystemPath>    "DISPDIB.DLL",   10000)
  357. CopyFile ("VER.DLL",      <SystemPath>    "VER.DLL",       80000)
  358. CopyFile ("MCIAVI.DRV",   <SystemPath>    "MCIAVI.DRV",    50000)
  359. CopyFile ("INDEO.DRV",    <SystemPath>    "INDEO.DRV",     20000)
  360. CopyFile ("MSVIDC.DRV",   <SystemPath>    "MSVIDC.DRV",    20000)
  361. CopyFile ("MSVIDEO.DLL",  <SystemPath>    "MSVIDEO.DLL",   20000)
  362. CopyFile ("MPLAYER.EXE",  <WinPath>       "MPLAYER.EXE",   50000)
  363. CopyFile ("MPLAYER.HLP",  <WinPath>       "MPLAYER.HLP",   25000)
  364. CopyFile ("MPLAYER.REG",  <WinPath>       "MPLAYER.REG",   10000)
  365. CopyFile ("MCIOLE.DLL",   <WinPath>       "MCIOLE.DLL",    10000)
  366.  
  367.     ;;
  368.     ;; CloseCopyProgress ()
  369.     ;; --------------------
  370.     ;; This command closes the copy progress bar.
  371.     ;;
  372.  
  373. CloseCopyProgress ()
  374.  
  375.     ;;*************Begin Title Specific Section***************************
  376.  
  377. ;;
  378.     ;; OpenProgmanProgress (Message, Instructions)
  379.     ;; -------------------------------------------
  380.     ;; This command begins a Program Manager installation section.
  381.     ;; This command will put up a progress bar with the message 'Message'
  382.     ;; and the instructions 'Instructions'.  Following this command, only
  383.     ;; the commands 'SetProgressBarMsg', 'OpenProgmanGroup', 'ErrorExit',
  384.     ;; 'AddProgmanItem', 'Goto', 'IfEqualGoto', 'IfNotEqualGoto',
  385.     ;; 'IfLowerGoto', 'IfHigherGoto', 'IfFileExistsGoto', and 'Pause' are
  386.     ;; allowed until the 'CloseProgmanProgress' command is reached.  An
  387.     ;; error is reported and Setup is aborted if any other commands are
  388.     ;; encountered while the progress bar is displayed.
  389.     ;;
  390.  
  391. ; Begin adding Progam Manager groups
  392. ;
  393. OpenProgmanProgress (
  394.     "Setup is adding Program Manager groups.",
  395.     "Please wait while Setup adds {\b Program Manager} groups".)
  396.  
  397.     ;;
  398.     ;; OpenProgmanGroup (Group[,  DeleteFlag])
  399.     ;; ---------------------------------------
  400.     ;; This command will set up a DDE conversation with the Program 
  401.     ;; Manager and open the program group entitled 'Group'.  If the 
  402.     ;; optional string 'Delete' is specified and is equal to "Delete", 
  403.     ;; then the specified group will be deleted if it exists, before it is
  404.     ;; created.  Normally this Delete flag is specified to create a new 
  405.     ;; program group, and is omitted to add to an existing group. 
  406.     ;; 
  407.     ;; The progress bar will display the words "Opening" followed by the
  408.     ;; name of the ProgMan group.  If OpenProgmanGroup fails then no error
  409.     ;; is reported.
  410.     ;;
  411.  
  412. ; Add a specific Program Manager group.
  413. ;
  414. OpenProgmanGroup (<TitleName>, Delete)    ;; Add the group named after the title
  415.  
  416.     ;;
  417.     ;; AddProgmanItem (Item, Command, IconFile, IconNumber)
  418.     ;; ----------------------------------------------------
  419.     ;; This command will add a new icon to the Program Manager group 
  420.     ;; opened by OpenProgmanGroup.  The icon will have the title 'Item',
  421.     ;; the command string 'Command', the icon file 'IconFile' and the
  422.     ;; 0-based icon index within the icon file 'IconNumber'.  Variables
  423.     ;; can be used to specify a complete path for the command and icon
  424.     ;; files that are dependent on the user's path choices.
  425.     ;;
  426.     ;; The progress bar will display the words "Adding" followed by the 
  427.     ;; item name.  If AddProgramItem fails then no error is reported.
  428.     ;;
  429.  
  430. AddProgmanItem (<TitleName>,<ViewerDestDir>"VIEWER.EXE "<ViewerSrcDir>"JAZZ\"<TitleMVB>".MVB",<ViewerSrcDir>"JAZZ\COMPTONS.ICO",0)
  431.  
  432.     ;;
  433.     ;; CloseProgmanProgress ()
  434.     ;; -----------------------
  435.     ;; This command closes the ProgMan DDE conversation.
  436.     ;;
  437.  
  438. CloseProgmanProgress ()
  439.  
  440.  
  441.     ;;
  442.     ;; AddToProfileIni (File, Tag, Name, Value)
  443.     ;; ----------------------------------------
  444.     ;; This command is identical to AddToWinIni, except that any profile
  445.     ;; file can be used.  This can be used to access the SYSTEM.INI file
  446.     ;; and any other private profile files.  No error is reported if this
  447.     ;; operation fails.
  448.     ;;
  449.  
  450. ; Update VIEWER.INI.
  451. ;
  452. AddToProfileIni ("VIEWER.INI", <TitleMVB>, "Path", 
  453.     <ViewerSrcDir> <TitleSrcDir>)
  454. AddToProfileIni ("VIEWER.INI", "Files", <TitleMVB> ".MVB", 
  455.     <ViewerSrcDir> <TitleSrcDir>
  456.     ",Please insert the " <TitleName> " CD in the CD-ROM drive")
  457.  
  458.     ;;    For each of the other books in a multiple-book title, add
  459.     ;;    a VIEWER.INI section that is named after the basename of
  460.     ;;    that book's MVB file (which should be in the same directory
  461.     ;;    as the main title's MVB file).
  462.     ;;
  463. AddToProfileIni ("VIEWER.INI", 
  464.     "JAZZ",        ; Basename of the MVB file
  465.     "Path", <ViewerSrcDir> <TitleSrcDir>)
  466.  
  467.     ;;***************End Title Specific Section***************************
  468.  
  469.     ;;
  470.     ;; AddToWinIni (Tag, Name, Value)
  471.     ;; ------------------------------
  472.     ;; This command adds or modifies the WIN.INI file entry 'Name' under
  473.     ;; the tag 'Tag' to equal the string 'Value'.  No error is reported if
  474.     ;; this operation fails.
  475.     ;;
  476.  
  477. ; Update WIN.INI.
  478. ;
  479. AddToWinIni ("Multimedia Viewer", "ViewerPath", <ViewerDestDir>)
  480. AddToWinIni ("Extensions", "mvb", "viewer.exe ^.mvb")
  481. AddToWinIni ("MCI Extensions", "avi", "AVIVideo")
  482.  
  483. AddToProfileIni ("SYSTEM.INI","mci","AVIVideo","mciavi.drv")
  484. AddToProfileIni ("SYSTEM.INI","drivers","VIDC.MSVC","msvidc.drv")
  485. AddToProfileIni ("SYSTEM.INI","drivers","VIDC.RT21","indeo.drv")
  486. AddToProfileIni ("MPLAYER.INI","options","AVIVideo","62")
  487. AddToProfileIni ("MPLAYER.INI","devices","AVIVideo","350, Video for Windows")
  488. AddToProfileIni ("EBAVI.INI",<TitleMVB>,"Path",<ViewerSrcDir>"JAZZ\VIDEO\")
  489.  
  490.  
  491.     ;;
  492.     ;; ModifyAutoexec (Path, Lib, Include, AskInstructions, 
  493.     ;;        ReviewInstructions, SaveInstructions)
  494.     ;; ----------------------------------------------------
  495.     ;; This command ensures that the following environment variables in
  496.     ;; the AUTOEXEC.BAT file are set:
  497.     ;;
  498.     ;;    1. the path 'Path' is present in the PATH variable
  499.     ;;    2. the path 'Lib' is present in the LIB variable
  500.     ;;    3. the path 'Include' is present in the INCLUDE variable
  501.     ;; 
  502.     ;; If any of  'Path', 'Lib', or 'Include' is the null string (""),
  503.     ;; then the corresponding environment variable is ignored.
  504.     ;;
  505.     ;; If an environment variable needs to be changed, a dialog window
  506.     ;; is brought up.  If all the required paths are already in the
  507.     ;; current environment variables, then no dialog is shown.  The
  508.     ;; instruction window contains the instruction text 'AskInstructions'.
  509.     ;;
  510.     ;; If the default option to make the modifications is selected, then
  511.     ;; the old AUTOEXEC.BAT file is saved to AUTOEXEC.BAK and the required
  512.     ;; changes are made to the current AUTOEXEC.BAT file.  Paths are added
  513.     ;; to the beginning of the path list in the PATH, SET LIB, and
  514.     ;; SET INCLUDE statements.   If the statement to set the appropriate
  515.     ;; environment variable is not present then the statement is added to
  516.     ;; the end of the AUTOEXEC.BAT file.  If the AUTOEXEC.BAT file is not
  517.     ;; found, then a new AUTOEXEC.BAT file is created to contain these
  518.     ;; new statements.
  519.     ;;
  520.     ;; If the option to review and edit the changes is chosen then the
  521.     ;; following dialog is shown:
  522.     ;;
  523.     ;; The upper edit box shows the proposed changes to the AUTOEXEC.BAT
  524.     ;; file and the lower edit box shows the current AUTOEXEC.BAT file
  525.     ;; contents.  The instruction window shows the instructon text
  526.     ;; 'ReviewInstructions'.   Any changes made to the upper edit box are
  527.     ;; saved when the user clicks on the OK default button or presses
  528.     ;; <Enter> to save the changes.  The old AUTOEXEC.BAT is saved to the
  529.     ;; file AUTOEXEC.BAK before the changes are made.  The Cancel button
  530.     ;; brings back the previous dialog.
  531.     ;;
  532.     ;; If the option to make the modifications later is chosen then the
  533.     ;; following dialog is shown:
  534.     ;;
  535.     ;; Here the user can specify a file that will contain the
  536.     ;; modifications made to the AUTOEXEC.BAT file.  The instruction
  537.     ;; window shows the instruction text 'SaveInstructions'.  The default
  538.     ;; filename is AUTOEXEC.NEW, but the user can changes this by editing
  539.     ;; the file in the dialog box.  To save the changes to the specified
  540.     ;; file, the user clicks on the Save button or presses 'S' or Enter.
  541.     ;; To not save the changes, the user clicks on the Don't Save button.
  542.     ;; To return to the previous dialog, the user clicks on the Cancel
  543.     ;; button or presses Esc.
  544.     ;;
  545.  
  546. ; Add the Viewer path to the PATH variable in the environment.
  547. ;
  548. ModifyAutoexec (<ViewerDestDir>, "", "",
  549.     "Setup must now make some changes to your {\b AUTOEXEC.BAT} file.  "
  550.     "Click on the desired option and click on {\b OK} to continue.  With "
  551.     "the keyboard, use the arrow keys to select the desired option, and "
  552.     "then press {\b Enter} to continue.\par\par "
  553.     "{\b o} Select the first option to let Setup modify your "
  554.     "AUTOEXEC.BAT file\par "
  555.     "{\b o} Select the second option to view and change the changes "
  556.     "first\par "
  557.     "{\b o} Select the third option if you want to make the changes "
  558.     "yourself later on\par\par ",
  559.     "You can now view the proposed changes to the {\b AUTOEXEC.BAT} "
  560.     "file.  If the changes were not made to your satisfaction, you can "
  561.     "modify the proposed batch file by editing the file in the top "
  562.     "window.  Click on {\b OK} or press {\b Enter} to replace the "
  563.     "current batch file with the proposed one.  To return to the "
  564.     "AUTOEXEC modification options dialog, click on {\b Cancel} or press "
  565.     "{\b Esc}.", 
  566.     "Setup can save the proposed {\b AUTOEXEC.BAT} file to a file that "
  567.     "you specify.  You will have to modify your own {\b AUTOEXEC.BAT} "
  568.     "file yourself and then reboot your computer in order for the Viewer "
  569.     "to function normally.  To return to the AUTOEXEC modification "
  570.     "options dialog, click on {\b Cancel} or press {\b Esc}.")
  571.  
  572. ; Assemble and display finished message
  573.  
  574.     ;;
  575.     ;; IfIncompleteGoto (Label)
  576.     ;; ------------------------
  577.     ;; This command will branch to the label 'Label' if the installation
  578.     ;; was incomplete.  The installation is incomplete if there was an
  579.     ;; error for any file that was copied to the hard disk and the user
  580.     ;; specified to ignore the error.  The installation is also incomplete
  581.     ;; if the 'SetIncomplete' command was executed.
  582.     ;;
  583.  
  584. IfIncompleteGoto (Incomplete)
  585.     SetVariable (Message, 
  586.         "%nThe Setup program has successfully installed%n"
  587.         "the Multimedia Viewer and "<TitleName> ".%n%n")
  588.     Goto (CheckAutoexec)
  589. Incomplete:
  590.     SetVariable (Message,
  591.         "Setup has finished, but the installation was incomplete.  "
  592.         "You should correct any problems (such as insufficient disk "
  593.         "space, missing source files, or locked directories) and run "
  594.         "Setup again.%n%n")
  595.  
  596.  
  597. CheckAutoexec:
  598.  
  599.     ;;
  600.     ;; IfMustModifyGoto (Label)
  601.     ;; ------------------------
  602.     ;; This command will branch to the label 'Label' if Setup had to 
  603.     ;; modify the AUTOEXEC.BAT file, but the user chose to do the
  604.     ;; modifications themselves later.  The command will also branch
  605.     ;; if the 'SetMustModify' command was executed.
  606.     ;;
  607.  
  608. IfMustModifyGoto (MustModify)
  609.  
  610.     ;;
  611.     ;; IfMustRebootGoto (Label)
  612.     ;; ------------------------
  613.     ;; This command will branch to the label 'Label' if Setup has
  614.     ;; modified the AUTOEXEC.BAT file, and the user
  615.     ;; must now reboot the computer.  The command will also branch
  616.     ;; if the 'SetMustReboot' command was executed.
  617.     ;;
  618.  
  619. IfMustRebootGoto (MustReboot)
  620. Goto (End)
  621.  
  622.  
  623. MustModify:
  624.  
  625. SetVariable (Message, 
  626.     <Message> "Remember to modify your AUTOEXEC.BAT file and reboot your "
  627.     "computer before using the Multimedia Viewer.%n%n")
  628. Goto (End)
  629.  
  630.  
  631. MustReboot:
  632.  
  633. SetVariable (Message,
  634.     <Message> "For the changes made by Setup to come into "
  635.     "effect, you must reboot your computer.  To do this, you must first "
  636.     "exit Windows and then simultaneously hold down the Ctrl, Alt, and "
  637.     "Del keys.  You must do this before using the Multimedia Viewer.%n%n")
  638.  
  639.  
  640. End:
  641.  
  642. Execute("PROFDISP.EXE",1)
  643.  
  644. SetVariable (Message, 
  645.     <Message> "%nThe advantages of being a registered user are numerous.%n"
  646.     "Please send in your Product Registration Card TODAY.")
  647.  
  648. DisplayMessage (<Message>, 
  649.     "Click on {\b OK} or press {\b Enter} to return to the "
  650.     "Program Manager.")
  651.  
  652.  
  653.  
  654.     ;;
  655.     ;; The following are other commands that Setup recognizes
  656.     ;;
  657.     ;;
  658.     ;; IfNotEqualGoto (String1, String2, Label)
  659.     ;; ----------------------------------------
  660.     ;; This command will do a case insensitive compare on the strings
  661.     ;; 'String1' and 'String2' and branch to 'Label' if they do not match.
  662.     ;;
  663.     ;; IfHigherGoto (Number1, Number2, Label)
  664.     ;; --------------------------------------
  665.     ;; This command will compare 'Number1' and 'Number2', which are
  666.     ;; strings interpreted as long integers.  If 'Number1' is higher 
  667.     ;; than 'Number2' then execution branches to 'Label'.
  668.     ;;
  669.     ;; Add (Variable, Number)
  670.     ;; --------------------------
  671.     ;; This command will add the value 'Number' to the old value of the
  672.     ;; variable 'Variable', and store the result as the new value of
  673.     ;; 'Variable'.  Both the old value of 'Variable' and the string
  674.     ;; 'Number' are interpreted as long integers.
  675.     ;;
  676.     ;; Subtract (Variable, Number)
  677.     ;; -------------------------------
  678.     ;; This command will subtract the value 'Number' from the old value
  679.     ;; of the variable 'Variable', and store the result as the new value
  680.     ;; of 'Variable'.  Both the old value of 'Variable' and the string
  681.     ;; 'Number' are interpreted as long integers.
  682.     ;;
  683.     ;; SetProgressBarMsg (Message)
  684.     ;; ---------------------------
  685.     ;; This command changes the progress bar message to 'Message'.
  686.     ;; This is used to let the user know which group of files is currently
  687.     ;; being copied.
  688.     ;;
  689.     ;; GetWinSystemPath (Variable)
  690.     ;; ---------------------------
  691.     ;; This command sets the variable 'Variable' to the path of the
  692.     ;; Windows System directory.  The directory name ends in a backslash.
  693.     ;;
  694.     ;; Confirm (Variable, Default, Text, Instructions)
  695.     ;; -----------------------------------------------
  696.     ;; This command behaves identically to the AskYesNo command, except
  697.     ;; that it is used to confirm that the options that have been entered
  698.     ;; are correct.  The string 'Text' is normally built from the answers
  699.     ;; to the other prompt commands.
  700.     ;;
  701.     ;; PromptChangeDisk (DiskLabel, File, Instructions)
  702.     ;; ------------------------------------------------
  703.     ;; This command pops up a dialog window requesting the user to insert
  704.     ;; the disk labeled 'DiskLabel' into the current drive.  When the user
  705.     ;; clicks on the "OK" button or presses Enter, Setup checks to see
  706.     ;; that the file with the given name exists.  If the file does not
  707.     ;; exist then Setup assumes that the wrong disk was inserted and the
  708.     ;; dialog remains active.  This is repeated until the file is found,
  709.     ;; at which time the dialog box is removed and execution continues.
  710.     ;;
  711.     ;; UpdateFile (Source, Destination, Size)
  712.     ;; --------------------------------------
  713.     ;; This command is identical to the CopyFile command, except that if
  714.     ;; the destination file exists then it will read the version number
  715.     ;; of the source and the destination files and perform the copy only
  716.     ;; if the version number of the source file is higher than that of the
  717.     ;; destination file.  The source file must not be compressed for this
  718.     ;; to work.
  719.     ;;
  720.     ;; AppendFile (Source, Destination, Size)
  721.     ;; --------------------------------------
  722.     ;; This command is identical to the CopyFile command, except that the
  723.     ;; source file is appended to the destination file.  This command is 
  724.     ;; useful for copying files that span several volumes.
  725.     ;;
  726.     ;; Files compressed using the Windows SDK COMPRESS utility will
  727.     ;; automatically be decompressed as they are being copied to the hard
  728.     ;; disk. 
  729.     ;;
  730.     ;; TranslateFile (Source, Destination, Size, Tag1, Replacement1, 
  731.     ;;         Tag2, Replacement2, ...)
  732.     ;; -------------------------------------------------------------
  733.     ;; The TranslateFile command behaves just like the CopyFile command,
  734.     ;; except that all strings enclosed in double angle brackets (<<...>>)
  735.     ;; in the source file are treated as "tags" which, together with the
  736.     ;; angle brackets, get replaced by the corresponding replacement
  737.     ;; strings in the destination file.
  738.     ;;
  739.     ;; For instance, if the source file "SOURCE.BAT" contains the line
  740.     ;;
  741.     ;;     set WinDir=<<WinDir>>
  742.     ;;
  743.     ;; and the following commands are used to copy the file
  744.     ;;
  745.     ;;    GetWinPath (WindowsDir)
  746.     ;;    .
  747.     ;;    .
  748.     ;;    TranslateFile ("SOURCE.BAT", "DEST.BAT", 1000, 
  749.     ;;        "WinDir", <WindowsDir>)
  750.     ;;
  751.     ;; then the file "DEST.BAT" will contain the following line:
  752.     ;;
  753.     ;;    set WinDir=C:\WIN
  754.     ;;
  755.     ;; The tag can be up to 127 characters long.  If the tag is not listed
  756.     ;; with its replacement string then the tag and its angle brackets
  757.     ;; will not be present in the destination file.
  758.     ;;
  759.     ;; The source file can be compressed.  This command is not 
  760.     ;; particularly fast, so it is only suited for short files, like INI
  761.     ;; files and BAT files.
  762.     ;;
  763.     ;; RenameFile (CurrentName, NewName)
  764.     ;; ---------------------------------
  765.     ;; This command renames the file specified by 'CurrentName' to
  766.     ;; 'NewName'.  No error is reported if this command fails.
  767.     ;;
  768.     ;; DeleteFile (FileName)
  769.     ;; ---------------------
  770.     ;; This command deletes the file specified by 'FileName', if this
  771.     ;; file exists.  No error is reported if this command fails.
  772.     ;;
  773.     ;; GetFromProfileIni (Variable, File, Tag, Name, Default)
  774.     ;; ------------------------------------------------------
  775.     ;; This command is identical to GetFromWinIni except that any profile
  776.     ;; file can be used.
  777.     ;;
  778.     ;; Pause (Time)
  779.     ;; ------------
  780.     ;; This command will pause execution in the script file for the
  781.     ;; specified number of milliseconds.  This command can be used when
  782.     ;; copying files or modifying the Program Manager groups in order to
  783.     ;; give the user time to see what is happening.
  784.     ;;
  785.     ;; Execute (CommandString, DisplayType)
  786.     ;; ------------------------------------
  787.     ;; This command will launch the program specified in the string
  788.     ;; 'CommandString'.  Parameters can appear following the program name.
  789.     ;; The argument 'DisplayType' determines whether the program window is
  790.     ;; shown as hidden, normal, minimized, or maximized, as specified in
  791.     ;; the following table:
  792.     ;;
  793.     ;;    'DisplayType'                Effect
  794.     ;;        0            Window appears hidden
  795.     ;;        1            Window appears normal
  796.     ;;        2            Window appears minimized
  797.     ;;        3            Window appears maximized
  798.     ;;
  799.     ;; ErrorExit (Text)
  800.     ;; ---------------------
  801.     ;; This command forces Setup to exit after a fatal error.  A message
  802.     ;; box pops up with the message 'Text' explaining the error, and then
  803.     ;; Setup ends.
  804.     ;;
  805.     ;; SendWinIniChange (Section)
  806.     ;; --------------------------
  807.     ;; This command broadcasts a WM_WININICHANGE message to all top-level
  808.     ;; windows when changes have been made to the section 'Section' in
  809.     ;; the Windows initialization file, WIN.INI.  The section name does
  810.     ;; not include the square brackets.
  811.     ;;
  812.     ;; SendDevModeChange (Device)
  813.     ;; --------------------------
  814.     ;; This command broadcasts a WM_DEVMODECHANGE message to all top-level
  815.     ;; windows when changes have been made to the device-mode settings
  816.     ;; of the device 'Device'.
  817.     ;;
  818.     ;; ParseField (Variable, String, FieldPosition)
  819.     ;; --------------------------------------------
  820.     ;; This command sets the variable 'Variable' to be the field specified
  821.     ;; by the number 'FieldPosition' in the string 'String'.  Fields are
  822.     ;; separated by commas.  The first field in a string is in position 1.
  823.     ;; If the field position is out of bounds, or there is some other
  824.     ;; kind of error, then 'Variable' is set to an empty string.
  825.     ;;
  826.     ;; For example, 
  827.     ;;
  828.     ;;    ParseField (Var1, "Position 1, Position 2", 2)
  829.     ;;
  830.     ;; would set the variable 'Var1' to be "Position 2".
  831.     ;;
  832.     ;; MidString (Variable, String, StartPos, Span)
  833.     ;; --------------------------------------------
  834.     ;; This command sets the variable 'Variable' to be a substring of the
  835.     ;; string 'String'.  The substring starts at position 'StartPos' in
  836.     ;; the source string (which is 0-based) and is 'Span' characters long.
  837.     ;; If there are not enough characters in the string at position
  838.     ;; 'StartPos' to form the substring, then as many characters as
  839.     ;; possible will be formed from that position onward.  If 'StartPos'
  840.     ;; is not within the string, a fatal error will result.
  841.     ;;
  842.     ;; OpenMessageBox (Text, Instructions)
  843.     ;; -----------------------------------
  844.     ;; This command displays the message 'Text' in a dialog box and the
  845.     ;; instruction text 'Instructions' in the instructions window.
  846.     ;; The dialog box remains until a 'CloseMessageBox' command is
  847.     ;; issued.  Other commands can occur in the setup script between the
  848.     ;; 'OpenMessageBox' and 'CloseMessageBox' commands.
  849.     ;;
  850.     ;; CloseMessageBox ()
  851.     ;; ------------------
  852.     ;; This command closes a dialog box that was opened with the
  853.     ;; 'OpenMessageBox' command.
  854.     ;;
  855.     ;; FileErrorBox (Variable, Message, File)
  856.     ;; --------------------------------------
  857.     ;; This command puts up a dialog to handle file errors.  The dialog
  858.     ;; box contains three buttons: Abort, Retry, and Ignore.  Retry is
  859.     ;; the default button.  The box contains an error message 'Message'
  860.     ;; followed by the file 'File' that is in question.
  861.     ;;
  862.     ;; If the Ignore button is pressed, the variable 'Variable' is set to
  863.     ;; the string "Ignore".  If the Retry button is pressed, 'Variable' is
  864.     ;; set to "Retry".  If the Abort button is pressed, a dialog box will
  865.     ;; ask if the user wants to end Setup.  If the user chooses Yes, then
  866.     ;; Setup will end.  If the user chooses No, then 'Variable' is set
  867.     ;; to "Retry".
  868.     ;;
  869.     ;; SetIncomplete ()
  870.     ;; ----------------
  871.     ;; This command indicates that the installation was incomplete, 
  872.     ;; causing the 'IfIncompleteGoto' command to branch to the label
  873.     ;; in its argument list.
  874.     ;;
  875.     ;; SetMustModify ()
  876.     ;; ----------------
  877.     ;; This command indicates that Setup had to modify the AUTOEXEC.BAT 
  878.     ;; file, but the user chose to do the modifications later.  This will
  879.     ;; cause the 'IfMustModifyGoto' command to branch to the label
  880.     ;; in its argument list.
  881.     ;;
  882.     ;; SetMustReboot ()
  883.     ;; ----------------
  884.     ;; This command indicates that Setup has altered the system so that
  885.     ;; the user must reboot the computer for these changes to come into
  886.     ;; effect.  This will cause the 'IfMustRebootGoto' command to branch
  887.     ;; to the label in its argument list.
  888.     ;;
  889.     ;; EnumerateWinIni (Variable, Section)
  890.     ;; -----------------------------------
  891.     ;; This command enumerates the key names associated with the section
  892.     ;; 'Section' of WIN.INI.  The key names will be separated by commas,
  893.     ;; and will be stored in the variable 'Variable'.  If 'Section' does
  894.     ;; not exist, or there is some other error, then 'Variable' will be
  895.     ;; set to the empty string.  Do not specify the brackets '[' and ']'
  896.     ;; in 'Section'.
  897.     ;;
  898.     ;; EnumerateProfileIni (Variable, File, Section)
  899.     ;; ---------------------------------------------
  900.     ;; This command is identical to 'EnumerateWinIni' except that it 
  901.     ;; operates on any initialization file specified by the name 'File'.
  902.     ;;
  903.  
  904.     ;;
  905.     ;; Subroutines
  906.     ;; -----------
  907.     ;; Subroutines can be implemented in the Setup script using the 
  908.     ;; mechanism described as follows (an example subroutine call is 
  909.     ;; provided for the installation of PostScript fonts).
  910.     ;;
  911.     ;; A subroutine may require various input and output variables.  The
  912.     ;; input variables should be set before calling the subroutine.  These
  913.     ;; variables may be altered within the subroutine; do not expect them
  914.     ;; to remain constant.  After the subroutine returns, the output 
  915.     ;; variables contain the output values.  A special variable,
  916.     ;; 'Continuation', must also be set to contain the label at which
  917.     ;; the execution resumes after the subroutine returns.  Normally,
  918.     ;; this label will be immediately after the subroutine call.  The
  919.     ;; subroutine call itself is made by a 'Goto' statement to the 
  920.     ;; subroutine's entry label.
  921.     ;;
  922.     ;;    NOTE: All variables are global!
  923.     ;;
  924.     ;; The code for a subroutine requires certain statements.  The
  925.     ;; first statement should be a 'Goto' statement that skips over
  926.     ;; the entire subroutine so that it will only be activated if it is 
  927.     ;; explicitly called.  Thus, the last statement of the subroutine
  928.     ;; should be a label to which the first 'Goto' jumps to.  The second
  929.     ;; statement in the subroutine should be the entry label of the
  930.     ;; subroutine.  The next to last statement of the subroutine should
  931.     ;; be the statement 'Goto (<Continuation>)', which allows the 
  932.     ;; subroutine to return.  For the example PostScript font installation
  933.     ;; subroutine, the first and last lines are as follows:
  934.     ;;
  935.     ;;
  936.     ;;        Goto (subInstallPSFontEnd)
  937.     ;;        subInstallPSFont:
  938.     ;;        ;
  939.     ;;        ; {body of the subroutine}
  940.     ;;        ;
  941.     ;;        Goto (<Continuation>)
  942.     ;;        subInstallPSFontEnd:
  943.     ;;
  944.     ;;
  945.  
  946.     ;;
  947.     ;; Subroutine Code: subInstallPSFont
  948.     ;; ---------------------------------
  949.     ;; This subroutine installs PostScript fonts which consist of a
  950.     ;; Windows font metric table file (.PFM) and a PostScript font file
  951.     ;; (.PFA) for each font.
  952.     ;;
  953.     ;; Subroutine entry label:
  954.     ;;    subInstallPSFont
  955.     ;; Input variables:
  956.     ;;    MetricBase - base name of the Windows font metric table file
  957.     ;;    FontBase - base name of the PostScript font file
  958.     ;;    MetricPath - full pathname of metric file
  959.     ;;    FontPath - full pathname of font file
  960.     ;; Output variables:
  961.     ;;    (none)
  962.     ;; Continuation variable:
  963.     ;;    Continuation
  964.     ;;
  965.  
  966.     ;; Skip over the subInstallPSFont subroutine.  It will be activated
  967.     ;; only if it is explicitly "called".
  968.     ;;
  969. Goto (subInstallPSFontEnd)    
  970.  
  971.     ;; Begin the subInstallPSFont subroutine.
  972.     ;;
  973. subInstallPSFont:
  974.  
  975.     ; Local constant: Printer name.  Used in dialog boxes.
  976.     ;
  977. SetVariable (ipfPrinterName, "PostScript")
  978.  
  979.     ; Local constant: Subroutine name.  Used in error dialog boxes.
  980.     ;
  981. SetVariable (ipfSubroutineName, "subInstallPSFont")
  982.  
  983.     ; Local constant: Printer driver.  Basename of the driver for which
  984.     ; we are installing fonts.
  985.     ;
  986. SetVariable (ipfDriver, "PSCRIPT")
  987.  
  988.     ; Local constant: Destination directory for the metric and
  989.     ; font files.  We will put them into the Windows system directory.
  990.     ;
  991. GetWinSystemPath (ipfSystemPath)
  992.  
  993.  
  994. OpenMessageBox (
  995.     "Setup is installing the " <ipfPrinterName> " font consisting of "
  996.     <MetricBase> " and " <FontBase> ".",
  997.     "Please wait while Setup installs " <ipfPrinterName> " fonts.")
  998.  
  999.  
  1000.     ; Check if the metric and font files exist.
  1001.     ;
  1002. ipfCheckMetricPath:
  1003. IfFileExistsGoto (<MetricPath>, ipfMetricExists)
  1004.     FileErrorBox (ipfTmp , "The following file was not found:", 
  1005.         <MetricPath>)
  1006.     IfEqualGoto (<ipfTmp>, "Retry", ipfCheckMetricPath)
  1007.     SetIncomplete ()
  1008.     Goto (ipfFinished)
  1009. ipfMetricExists:
  1010.  
  1011. ipfCheckFontPath:
  1012. IfFileExistsGoto (<FontPath>, ipfFontExists)
  1013.     FileErrorBox (ipfTmp , "The following file was not found:", 
  1014.         <FontPath>)
  1015.     IfEqualGoto (<ipfTmp>, "Retry", ipfCheckFontPath)
  1016.     SetIncomplete ()
  1017.     Goto (ipfFinished)
  1018. ipfFontExists:
  1019.  
  1020.  
  1021.     ; Enumerate the different printers.  This information is found in the
  1022.     ; 'PrinterPorts' section of WIN.INI.
  1023.     ;
  1024. EnumerateWinIni (ipfPrinterPorts, "PrinterPorts")
  1025. IfNotEqualGoto (<ipfPrinterPorts>, "", ipfPrinterPortsOK)
  1026.     DisplayMessage (<ipfSubroutineName> ": "
  1027.         "There are no printers installed.%n%n"
  1028.         "The " <ipfPrinterName> " font consisting of " <MetricBase> 
  1029.         " and " <FontBase> " was not installed.",
  1030.         "")
  1031.     SetIncomplete ()
  1032.     Goto (ipfFinished)
  1033. ipfPrinterPortsOK:
  1034.  
  1035.  
  1036.     ; For each printer in the 'PrinterPorts' section, find out its
  1037.     ; associated printer information.  For example, ipfPrinterInfo might
  1038.     ; be "PSCRIPT,LPT2:,15,45,COM2:,15,45".  If the first field in the
  1039.     ; printer information matches the desired printer driver (ipfDriver),
  1040.     ; then install the fonts for each printer listed in the printer 
  1041.     ; information.
  1042.     ;
  1043. SetVariable (ipfPortIndex, 1)
  1044. ipfPortLoop:
  1045. ParseField (ipfPrinter, <ipfPrinterPorts>, <ipfPortIndex>)
  1046.     IfEqualGoto (<ipfPrinter>, "", ipfFinished)    ; End port loop
  1047. GetFromWinIni (ipfPrinterInfo, "PrinterPorts", <ipfPrinter>, "NONE")
  1048. IfNotEqualGoto (<ipfPrinterInfo>, "NONE", ipfPrinterInfoOK)
  1049.     DisplayMessage (<ipfSubroutineName> ": "
  1050.         "There was an error reading the '" <ipfPrinter> "' entry in "
  1051.         "the 'PrinterPorts' section of WIN.INI.%n%n",
  1052.         "The " <ipfPrinterName> " font consisting of " <MetricBase> 
  1053.         " and " <FontBase> " may not be completely installed.",
  1054.         "")
  1055.     SetIncomplete ()
  1056.     Goto (ipfPortInc)
  1057. ipfPrinterInfoOK:
  1058. ParseField (ipfDrv, <ipfPrinterInfo>, 1)
  1059. IfEqualGoto (<ipfDrv>, <ipfDriver>, ipfInstall)
  1060. ipfPortInc:
  1061. Add (ipfPortIndex, 1)
  1062. Goto (ipfPortLoop)
  1063.  
  1064.  
  1065. ipfInstall:
  1066.     ; Install the font for each PostScript printer
  1067.     ;
  1068. SetVariable (ipfIndex, 2)
  1069. ipfInstallLoop:
  1070. ParseField (ipfPrinterField, <ipfPrinterInfo>, <ipfIndex>)
  1071.     IfEqualGoto (<ipfPrinterField>, "", ipfPortInc)        ; End loop
  1072. MidString (ipfPort, <ipfPrinterField>, 0, 4)    ; Assume port names are 4
  1073.                         ; characters long
  1074. IfNotEqualGoto (<ipfPort>, "", ipfPortOK)
  1075.     DisplayMessage (<ipfSubroutineName> ": "
  1076.         "The WIN.INI file is defective.%n%n"
  1077.         "The " <ipfPrinterName> " font consisting of " <MetricBase> 
  1078.         " and " <FontBase> " may not be completely installed.",
  1079.         "")
  1080.     SetIncomplete ()
  1081.     Goto (ipfInstallInc)
  1082. ipfPortOK:
  1083. SetVariable (ppfContinuation, ipfInstallInc)
  1084. Goto (subPrinterPSFont)
  1085. ipfInstallInc:
  1086. Add (ipfIndex, 3)
  1087. Goto (ipfInstallLoop)
  1088.  
  1089.  
  1090. ipfFinished:
  1091. CloseMessageBox ()
  1092.     ; Return from subroutine
  1093.     ;
  1094. Goto (<Continuation>)
  1095.  
  1096.  
  1097.     ;; End of subInstallPSFont subroutine
  1098.     ;;
  1099. subInstallPSFontEnd:
  1100.  
  1101.  
  1102.     ;;
  1103.     ;; Subroutine Code: subPrinterPSFont
  1104.     ;; ---------------------------------
  1105.     ;; This subroutine installs PostScript fonts for each PostScript
  1106.     ;; printer that is installed.  Each printer is identified by its
  1107.     ;; printer port (e.g. "LPT2").  This subroutine is called by the
  1108.     ;; subInstallPSFont subroutine.
  1109.     ;;
  1110.     ;; Subroutine entry label:
  1111.     ;;    subPrinterPSFont
  1112.     ;; Input variables:
  1113.     ;;    MetricBase - base name of the Windows font metric table file
  1114.     ;;    FontBase - base name of the PostScript font file
  1115.     ;;    MetricPath - full pathname of metric file
  1116.     ;;    FontPath - full pathname of font file
  1117.     ;;    ipfPort - printer port for the particular PostScript printer
  1118.     ;;    ipfSystemPath - destination directory for the metric and font
  1119.     ;;        files
  1120.     ;;    ipfPrinter - printer type
  1121.     ;; Output variables:
  1122.     ;;    (none)
  1123.     ;; Continuation variable:
  1124.     ;;    ppfContinuation
  1125.     ;;
  1126.  
  1127.     ;; Skip over the subPrinterPSFont subroutine.  It will be activated
  1128.     ;; only if it is explicitly "called".
  1129.     ;;
  1130. Goto (subPrinterPSFontEnd)
  1131.  
  1132.     ;; Begin the subPrinterPSFont subroutine.
  1133.     ;;
  1134. subPrinterPSFont:
  1135.  
  1136.  
  1137.     ; Local constant: Prefix for the WIN.INI section of this particular
  1138.     ; printer.
  1139.     ;
  1140. SetVariable (ppfPrefix, "PostScript,")
  1141.  
  1142.  
  1143.     ; Determine the destination paths of the metric and font files.
  1144.     ;
  1145. SetVariable (ppfMetricDest, <ipfSystemPath> <MetricBase>)
  1146. SetVariable (ppfFontDest, <ipfSystemPath> <FontBase>)
  1147.  
  1148.  
  1149.     ; Determine the value to store in the WIN.INI entry
  1150.     ;
  1151. SetVariable (ppfValue, <ppfMetricDest> "," <ppfFontDest>)
  1152.  
  1153.  
  1154.     ; Determine the section name of the printer, which is the section 
  1155.     ; prefix and the printer port separated by a comma.
  1156.     ;
  1157.     ; For example, Section may be "PostScript,LPT2" for a PostScript 
  1158.     ; printer connected to printer port #2.
  1159.     ;
  1160. SetVariable (ppfSection, <ppfPrefix> <ipfPort>)
  1161.  
  1162.  
  1163.     ; Determine the number of soft fonts already installed.
  1164.     ;
  1165. GetFromWinIni (ppfSoftFonts, <ppfSection>, "softfonts", 0)
  1166.  
  1167.  
  1168.     ; Check if the metric file or the font file has already been 
  1169.     ; installed.  The softfont index (ppfIndex) and the number of 
  1170.     ; softfonts encountered (ppfCount) may not be the same since the
  1171.     ; softfonts may not be numbered consecutively.
  1172.     ;
  1173. SetVariable (ppfIndex, 1)    ; softfont index
  1174. SetVariable (ppfCount, 1)    ; number of softfonts encountered
  1175. ppfCheckLoop:
  1176. IfHigherGoto (<ppfCount>, <ppfSoftFonts>, ppfLook)
  1177. GetFromWinIni(ppfFontEntry, <ppfSection>, "softfont" <ppfIndex>, "NONE")
  1178. IfEqualGoto (<ppfFontEntry>, "NONE", ppfCheckInc)    ; non-consecutive
  1179. IfEqualGoto (<ppfFontEntry>, <ppfValue>, ppfFinished)    ; already installed
  1180. Add (ppfCount, 1)
  1181. ppfCheckInc:
  1182. Add (ppfIndex, 1)
  1183. Goto (ppfCheckLoop)
  1184.  
  1185.  
  1186. ppfLook:
  1187.     ; Look for the first empty slot to put in the new softfont entry
  1188.     ;
  1189. SetVariable (ppfLookIndex, 1)
  1190. ppfLookLoop:
  1191. IfHigherGoto (<ppfLookIndex>, <ppfSoftFonts>, ppfInstall)
  1192. GetFromWinIni(ppfFontEntry, <ppfSection>, "softfont" <ppfLookIndex>, "NONE")
  1193. IfEqualGoto (<ppfFontEntry>, "NONE", ppfInstall)
  1194. ppfLookInc:
  1195. Add (ppfLookIndex, 1)
  1196. Goto (ppfLookLoop)
  1197.  
  1198.  
  1199. ppfInstall:
  1200.     ; Update the softfont fields in the WIN.INI file.
  1201.     ; Notify Windows that the WIN.INI file has changed.
  1202.     ;
  1203. Add (ppfSoftFonts, 1)
  1204. AddToWinIni (<ppfSection>, "softfonts", <ppfSoftFonts>)
  1205. AddToWinIni (<ppfSection>, "softfont" <ppfLookIndex>, <ppfValue>)
  1206. SendWinIniChange (<ppfSection>)
  1207.  
  1208.  
  1209. ppfFinished:
  1210.     ; Copy the metric and font files.  Do this in all cases since the
  1211.     ; metric and font files may have changed, although their names
  1212.     ; have not.
  1213.     ;
  1214. CopyFile (<MetricPath>, <ppfMetricDest>, 1)
  1215. CopyFile (<FontPath>, <ppfFontDest>, 1)
  1216.  
  1217.  
  1218.     ; Notify Windows that the font files for the printer driver have
  1219.     ; changed.
  1220.     ;
  1221. SendDevModeChange (<ipfPrinter>)
  1222.  
  1223.  
  1224.     ; Return from subroutine
  1225.     ;
  1226. Goto (<ppfContinuation>)
  1227.  
  1228.     ;; End of subPrinterPSFont subroutine
  1229.     ;;
  1230. subPrinterPSFontEnd:
  1231. 
  1232.